package org.vacoor.ticket.bean;

/*
 * 座位类型
 */
public enum SeatType {
	/*
	 {"end_station_name":"","end_time":"","id":"Q","start_station_name":"","start_time":"","value":"观光座"},
     {"end_station_name":"","end_time":"","id":"S","start_station_name":"","start_time":"","value":"一等包座"}
	 */
	BUSS_SEAT("商务座","9"), BEST_SEAT("特等座","P"), ONE_SEAT("一等座","M"),TWO_SEAT("二等座","O"),
	VAG_SLEEPER("高级软卧","6"),SOFT_SLEEPER("软卧","4"),HARD_SLEEPER("硬卧","3"),
	SOFT_SEAT("软座","2"), HARD_SEAT("硬座","1"),
	/*
	 * 这里无座信息处理有误,
	 * 
	 * 对于动车D(包括高铁G)无座和二等座代码一样为O
	 * 对于快车K/特快T/其他QT/直达Z无座和硬座一样为
	 */
	NONE_SEAT("无座","1");
	
	private String name;
	private String value;
	
	SeatType(String name,String value) {
		this.name = name;
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public String toString() {
		return name + "[代码:" + value + "]";
	}
}
/*以下为js
var linkAddress = 'http://dynamic.12306.cn/TrainQuery/skbcx.jsp?';
var maxPeriod = '2012-10-07 15:27:03';
var minPeriod = '2012-09-26 15:27:03';
var maxTicketNum =  '5';
var index_seatTypeAndNum =  '';
var index_train_class =  '';
var ctx ='/otsweb';
//设置查询结果
var indexQueryResult = "null";
var seatTypeRelation = jQuery.parseJSON(
      '{
      "D":
      [
      {"end_station_name":"","end_time":"","id":"4","start_station_name":"","start_time":"","value":"软卧"},
      {"end_station_name":"","end_time":"","id":"6","start_station_name":"","start_time":"","value":"高级软卧"},
      {"end_station_name":"","end_time":"","id":"9","start_station_name":"","start_time":"","value":"商务座"},
      {"end_station_name":"","end_time":"","id":"M","start_station_name":"","start_time":"","value":"一等座"},
      {"end_station_name":"","end_time":"","id":"O","start_station_name":"","start_time":"","value":"二等座"},
      {"end_station_name":"","end_time":"","id":"P","start_station_name":"","start_time":"","value":"特等座"},
      {"end_station_name":"","end_time":"","id":"Q","start_station_name":"","start_time":"","value":"观光座"},
      {"end_station_name":"","end_time":"","id":"S","start_station_name":"","start_time":"","value":"一等包座"}
      ],
      "Z":
      [
      {"end_station_name":"","end_time":"","id":"1","start_station_name":"","start_time":"","value":"硬座"},
      {"end_station_name":"","end_time":"","id":"2","start_station_name":"","start_time":"","value":"软座"},
      {"end_station_name":"","end_time":"","id":"3","start_station_name":"","start_time":"","value":"硬卧"},
      {"end_station_name":"","end_time":"","id":"4","start_station_name":"","start_time":"","value":"软卧"},
      {"end_station_name":"","end_time":"","id":"6","start_station_name":"","start_time":"","value":"高级软卧"}
      ],
         "T":
            [
            {"end_station_name":"","end_time":"","id":"1","start_station_name":"","start_time":"","value":"硬座"},
            {"end_station_name":"","end_time":"","id":"2","start_station_name":"","start_time":"","value":"软座"},
            {"end_station_name":"","end_time":"","id":"3","start_station_name":"","start_time":"","value":"硬卧"},
            {"end_station_name":"","end_time":"","id":"4","start_station_name":"","start_time":"","value":"软卧"},
            {"end_station_name":"","end_time":"","id":"6","start_station_name":"","start_time":"","value":"高级软卧"}
      ],
         "K":
            [
            {"end_station_name":"","end_time":"","id":"1","start_station_name":"","start_time":"","value":"硬座"},
            {"end_station_name":"","end_time":"","id":"2","start_station_name":"","start_time":"","value":"软座"},
            {"end_station_name":"","end_time":"","id":"3","start_station_name":"","start_time":"","value":"硬卧"},
            {"end_station_name":"","end_time":"","id":"4","start_station_name":"","start_time":"","value":"软卧"},
            {"end_station_name":"","end_time":"","id":"6","start_station_name":"","start_time":"","value":"高级软卧"}
      ],
         "QT":
            [
            {"end_station_name":"","end_time":"","id":"1","start_station_name":"","start_time":"","value":"硬座"},
            {"end_station_name":"","end_time":"","id":"2","start_station_name":"","start_time":"","value":"软座"},
            {"end_station_name":"","end_time":"","id":"3","start_station_name":"","start_time":"","value":"硬卧"},
            {"end_station_name":"","end_time":"","id":"4","start_station_name":"","start_time":"","value":"软卧"},
            {"end_station_name":"","end_time":"","id":"6","start_station_name":"","start_time":"","value":"高级软卧"}
      ]
      }'
);
*/
